<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
      xmlns:layout="http://www.ultrag.net.nz/thymeleaf/layout">

<head>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>注册</title>

    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" />
    <link th:href="@{/font-awesome/css/font-awesome.css}" rel="stylesheet" />
    <link th:href="@{/css/plugins/iCheck/custom.css}" rel="stylesheet" />
    <link th:href="@{/css/animate.css}" rel="stylesheet" />
    <link th:href="@{/css/style.css}" rel="stylesheet" />

</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen   animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">AU+</h1>

            </div>
            <h3>注册 AU+</h3>
            <p>创建一个直播账号与你所有关心的人分享</p>
            <form id="redisForm" class="m-t" role="form" action="./register" method="post" onsubmit="return checkBox();" th:object="${user}">
                <div class="form-group">
                    <input type="text" class="form-control {required:true,isName:true,messages:{required:'用户名不能为空'}}" placeholder="用户名"  th:field="*{name}"  />
                </div>
                 <div class="form-group">
                    <input type="email" class="form-control {required:true,isEmail:true,existEmail:true,messages:{required:'邮箱不能为空'}}" placeholder="邮箱" th:field="*{email}"  />
                </div>                      
                <div class="form-group">
                    <input type="password" class="form-control {required:true,isPassword:true,messages:{required:'密码不能为空'}}" placeholder="密码" th:field="*{password}"  />
                </div>
                <div class="form-group">
                        <div id="checkbox" class="checkbox i-checks"><label> <input type="checkbox" /><i></i> Agree the terms and policy </label></div>
                </div>
                <button type="submit" class="btn btn-primary block full-width m-b">注册</button>

                <p class="text-muted text-center"><small>已经有一个账号?</small></p>
                <a class="btn btn-sm btn-white btn-block" href="login">登陆</a>
            </form>
            <p class="m-t"> <small>AU+直播  &copy; 2017</small> </p>
        </div>
    </div>

    <!-- Mainly scripts -->
    <script th:src="@{js/jquery-2.1.1.js}"></script>
    <script th:src="@{js/jquery.metadata.js}"></script>
    <script th:src="@{js/jquery.validate.min.js}"></script>
     <script th:src="@{js/register.validate.js}"></script>
    <script th:src="@{js/bootstrap.min.js}"></script>
    <!-- iCheck -->
    <script th:src="@{js/plugins/iCheck/icheck.min.js}"></script>
    <script>
    $(document).ready(function(){
    	 $('.i-checks').iCheck({
             checkboxClass: 'icheckbox_square-green',
             radioClass: 'iradio_square-green',
         });
    });
    
    function checkBox() {  
       if($("#redisForm .icheckbox_square-green").is('.checked')){    	  
    	   return true;
       }else{
    	   alert("确认信息完整并同意《协议》后方可提交！");
    	   return false;
       }  
      
    }  
    </script>
</body>

</html>
